/*
 * @Date: 2024-11-27 16:03:54
 * @LastEditors: lyx
 * @LastEditTime: 2024-12-05 15:19:29
 * @FilePath: \sup-tpt-shell-engineering\src\pages\index\api.ts
 * @Description:
 */
/**
 * 页面接口
 *
 */
import { request } from "@/lib/request";

export const getOpenIdList = (data = {}) => {
  return request({
    url: "/mt-wx-server/weapp-official-accounts/getUserList/supTPT",
    method: "get",
    data,
  });
};

export const setCookie = (data = {}) => {
  return request({
    url: "/mt-wx-server/weapp/setCookie",
    method: "POST",
    data,
  });
};

export interface IBindUserParams {
  tenant: string;
  tenantAppId: string;
  inviteCode: string;
  phoneNumber: string;
}
export const bindUser = (data: IBindUserParams) => {
  return request({
    url: "/mt-wx-server/weapp-official-accounts/mini/bindUser",
    method: "POST",
    data,
  });
};

export interface IDecryptPhoneNumberParams {
  encryptedData: string;
  iv: string;
  code: string;
}
export const decryptPhoneNumber = (
  data: IDecryptPhoneNumberParams,
  tenant = "supTPT_mini"
) => {
  return request({
    url: `/mt-wx-server/weapp/decrypt/${tenant}`,
    method: "POST",
    data,
  });
};
